Lost Keys: Do you have a key that does not strike when pressed? You may have a bad switch or just a dirty key. Try this; With a small screwdriver carefully pry up and problem key cap. Using WD40 with the thin spray want that usually comes with it spray a tiny squirt along the edge of the key shaft. Work the key up and down a few times. Repeat 3 or 4 times until the key works. If it doesn't, then you will need a new switch. Talk to your Apple dealer about obtaining one (a solder job), or having one installed.
Spilled coffee: If you spilled a lot of your favorite drink into your keyboard and the obviously gummy keys are working only some of the time, you can take drastic measures before you throw it away for a new one. Gather your courage. Remove any cords you can from the keyboard. Take the keyboard apart and remove the circuit board and if possible the keyboard from the plastic shell. wrinse them under warm water, a bit hotter if the stuff you spilled is dry and gummy and needs to be disolved. Dry the board thoroughly with a hair dryer on moderate heat. Let it finish air-drying for a couple of days. When you are sure it is dry you can reassemble the unit. If you want you can lubricate the keys a bit with (very) slight amounts of WD40 into each key plunger after removing the caps (see Keyboards "lost keys"). If it doesn't work, I take no responsibility for your culinary inability.